<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
	<th:block th:include="include :: header('宰杀列表')" />
</head>
<body class="gray-bg">
<div class="container-div">
	<div class="row">
		<div class="col-sm-12 search-collapse">
			<form id="formId">
				<div class="select-list">
					<ul>
						<!--<li>
							宰杀时间
							：<input type="text" name="zaishaTime"/>
						</li>

						<li>
							宰杀数量：<input type="text" name="zaishaCount"/>
						</li>

						<li>
							宰杀前体况：<input type="text" name="zaishaQianTraining"/>
						</li>

						<li>
							宰杀后体况
							：<input type="text" name="zaishaHouTraining"/>
						</li>

						<li>
							宰杀操作人：<input type="text" name="zaishaOperation"/>
						</li>

						<li>
							备注：<input type="text" name="remark"/>
						</li>-->
						<li class="select-time">
							<label>日期： </label>
							<input type="text" class="time-input" id="startTime" placeholder="宰杀时间开始" name="params[beginZaishaTime]" lay-key="1">
							<span>-</span>
							<input type="text" class="time-input" id="endTime" placeholder="宰杀时间结束" name="params[endZaishaTime]" lay-key="2">
						</li>

						<li>
							<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
							<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
						</li>
					</ul>
				</div>
			</form>
		</div>

		<div class="btn-group-sm" id="toolbar" role="group">
			<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:ncZaisha:add">
				<i class="fa fa-plus"></i> 新增
			</a>
			<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:ncZaisha:edit">
				<i class="fa fa-edit"></i> 修改
			</a>
			<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:ncZaisha:remove">
				<i class="fa fa-remove"></i> 删除
			</a>
			<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:ncZaisha:export">
				<i class="fa fa-download"></i> 导出
			</a>
		</div>
		<div class="col-sm-12 select-table table-striped">
			<table id="bootstrap-table" data-mobile-responsive="true"></table>
		</div>
	</div>
</div>
<div th:include="include :: footer"></div>
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('system:ncZaisha:edit')}]];
    var removeFlag = [[${@permission.hasPermi('system:ncZaisha:remove')}]];
    var prefix = ctx + "system/ncZaisha";
    //宰杀前体况
    var qian=[[${@dict.getType('zaisha_qian_training')}]];
    //宰杀后体况
    var hou=[[${@dict.getType('zaisha_hou_training')}]];
    $(function() {
        var options = {
            url: prefix + "/list",
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove",
            exportUrl: prefix + "/export",
            modalName: "宰杀",
            showExport: false,
            showSearch: false,
            showRefresh: false,
            showColumns: false,
            showToggle: false,
            sortName:'zaishaTime',
            sortOrder:'desc',
            columns: [{
                checkbox: true
            },
                {
                    field : 'zaishaId',
                    title : '宰杀Id',
                    visible: false
                },
                {
                    title: '序号',
                    formatter: function (value, row, index) {
                        return $.table.serialNumber(index);
                    }
                },
                {
                    field : 'zaishaTime',
                    title : '宰杀时间',
                    sortable: true
				},
        {
            field : 'zaishaCount',
                title : '宰杀数量',
            sortable: true
        },
        {
            field : 'zaishaQianTraining',
                title : '宰杀前体况',
            sortable: true,
            formatter: function(value, row, index) {
                return $.table.selectDictLabel(qian, value);
            }
        },
        {
            field : 'zaishaHouTraining',
			title : '宰杀后体况',
            sortable: true,
            formatter: function(value, row, index) {
                return $.table.selectDictLabel(hou, value);
            }
        },
        {
            field : 'zaishaOperation',
                title : '宰杀操作人',
            sortable: true
        },
        {
            field : 'remark',
				title : '备注',
            sortable: true,
            formatter: function (value, row, index) {
                return $.table.tooltip(value);
            }
        },
        {
            title: '操作',
                align: 'center',
            formatter: function(value, row, index) {
            var actions = [];
            actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.zaishaId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
            actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.zaishaId + '\')"><i class="fa fa-remove"></i>删除</a>');
            return actions.join('');
        }
        }]
    };
        $.table.init(options);
    });
    setTitle("鸡舍管理-宰杀管理",true)
</script>
</body>
</html>